<?php

	class LanguageMapper Implements ArrayAccess {
		
		static private $instance;
		private $language;
		private $array;
		
		static public function inst ($language = '') {
			if (!self::$instance) {
				self::$instance = new self($language);
			}
			return self::$instance;
		}
		
		private function __construct($language) {
			
			$this->language = $language;
		
		}
		
		public function getLanguage() {
			
			return $this->language;
				
		}
		
		public function __get ($key) {
			
			if (!isset($this->array)) {
				$this->loadArray();
			}
			$this->offsetGet($key); 
			
		}
		
		private function loadArray () {
			
			$file = '../lang/' . $this->getLanguage() . '.php';
			require_once $file;
			$this->array = values;
			
		}
		
		function offsetExists($offset){
			
			return isset($this->array[$offset]);
			
		}
	 
		function offsetGet($offset){
			
			if ($this->offsetExists($offset))
				return $this->array[$offset];
			else 
				return $offset;
		}
	 
		function offsetSet($offset, $value){
			//
		}
	 
		function offsetUnset($offset){
			//
		}
		
	}